
<!--  <script type="text/javascript" src="__PUBLIC__/js/jquery.progressbar.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery.progressbar.js"></script>
 <script type="text/javascript">
    $(document).ready(function () {
　　　　$("#progress1").progressBar({$percent}, { barImage: '__PUBLIC__/images/progressbg_green.gif' });
　　});
</script> --> 

<script type="text/javascript">
function getgoods()
{
	var goodid=document.getElementById('goodid');
	if(goodid.value==''||goodid.value==null)
	{
		alert('请选择商品');
		return false;
	}
	var url="__URL__/getgood";
	$.ajax({
		type: 'POST',
		url:url,
		data:{'id':goodid.value},
		dataType:"json",
		cache: false,
		success: succ,
		error: DWZ.ajaxError
	});
}

function succ(json)
{
	if (json.statusCode == DWZ.statusCode.ok)
	  {
		document.getElementById('spans').style.width=json.data+"%";
		document.getElementById('precent').innerHTML=json.data+"%";
	 }
	else
		{
		document.getElementById('spans').style.width="0%";
		document.getElementById('precent').innerHTML="0%";
		}
	}
</script>

<script type="text/javascript">
				function setapprovrVal() {
					
					
					//var quality=document.getElementById('quality').value;
					//金额
					var totalprice = document.getElementById('receivedamount');
					//单价
					var price = document.getElementById('univalence');
					//量
					var quality = document.getElementById('capacity');
					//totalprice.value=quality*price;
					if(totalprice.value!=null&&totalprice.value!=""&&price.value!=null&&price.value!="")
					{
					  quality.value = (totalprice.value / price.value).toFixed(4);
					}
					else if(quality.value!=null&&quality.value!=""&&price.value!=null&&price.value!="")
					{
						totalprice.value=(quality.value*price.value).toFixed(4);
						
					}
				}
				
				function hideOrshow()
				{
					var payondelivery=document.getElementById("payondelivery");
					if(payondelivery.checked)
					{
						apphideText();
					}
					else
						{
						setapprovrVal();
						}
					
				}
				
				function apphideText()
				{
					document.getElementById('receivedamount').value="";
				}
			</script>

<div class="pageContent">

	<form method="post" action="__URL__/particularapprove/particlarpassapprove/true/navTabId/BlockOutapprove/callbackType/closeCurrent" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone)">
		<input type="hidden" name="approveid" value="<?php echo $_SESSION[C('USER_AUTH_KEY')] ?>">
		<input type="hidden" name="id" value="{$vo.id}" >
		<input type="hidden" name="ajax" value="1">
		<input type="hidden" name="pid" value="{$vo.pid}">
		<input type="hidden" name="contractno" value="{$vo.contractno}">
		<input type="hidden" name="blockoutid" value="{$blockoutid}" >
		<div class="pageFormContent" layoutH="58">
		<table  class="table" width="100%" nowrapTD="false">
			<tr>
			    <td>合同标题</td><td>{$vo.subject}</td>
			    <td>合同编号</td><td>{$vo.contractno}</td>
			</tr>
			
			<tr>
			    <td>签约人</td><td>{$vo.signupuser}</td>
			    <td>签约时间</td><td>{$vo.signuptime}</td>
			</tr>
			<tr>
			    <td>合同来源</td><td>{$vo.businesstype}</td>
			    <td>总数量</td><td>{$vo.quality}</td>
			</tr>
			<tr>
			    <td>已放量</td><td>{$vo.alshipment}</td>
			    <td>未放量</td><td>{$vo.notshipment}</td>
			</tr>
			<tr>
			    <td>主要条款</td><td colspan="3">{$vo.mainitem}</td>
			</tr>
			<tr>
			    <td>售后条款</td><td colspan="3">{$vo.salesafteritem}</td>
			</tr>
		
		</table>
		<br/>
		<table width="100%"  border="1" >
			<volist id="goodvo" name="conname">
				<tr>
				<td width='15%'><font color="red"><b>{$goodvo.goodname}</b></font></td>
			    <td>合同金额</td><td>{$goodvo.totalprice}</td>
			    <td>总数量</td><td>{$goodvo.quality}</td>
			    <td>已放量</td><td>{$goodvo.alshipment}</td>
			    <td>未放量</td><td>{$goodvo.notshipment}</td>
			</tr>
			</volist>
		</table>
			<p calss="unit">
			   <label style="margin-right: -10px;">商品名称</label>
			   <select name="goodid" id="goodid" class="required combox" onchange="getgoods();">
			     <option value="">请选择(必选)</option>
			     <volist id="good" name="conname">
			     <option value="{$good.id}">{$good.goodname}</option>
			     </volist>
			   </select>
			</p>
		 <P class="unit">
				<label>到款金额</label>
				<input type="text" class="number" id="receivedamount"  name="receivedamount" onblur="setapprovrVal();">
		 </p>
		  <div class="unit">
				<label>单价</label>
				<input type="text" class="number" id="univalence" name="univalence" onblur="setapprovrVal();">
		 </div>
		 <div class="unit">
				<label>放量(吨)</label>
				<input type="text"  class=" number" id="capacity" name="capacity" onblur="setapprovrVal();" onkeydown="apphideText();">
		     <label style="margin-right: -10px;">款到卸车(勾选为是)</label> 
			<input name="payondelivery" id="payondelivery" type="checkbox" value="1" onclick="hideOrshow();"/>
		 </div>
		 <div class="unit">
		 
		 </div>
		 <!-- <div class="unit">
			<label>指定调度人：</label> 
			<input class="required" name="controname" type="text" readonly="readonly"/>
			<input name="userid" type="hidden">
			<a class=" btnLook" href="__URL__/particularapprove/chooseReceiver/true" lookupGroup="">查找带回</a>
			</div> -->
		 <div class="unit">
				<label>备注</label>
				<textarea name="note" rows="3" cols="58" style="width: 400px;height: 50px;"></textarea>
		 </div>
		   <!-- <div class="unit" style="width: 500px;">
		    <div id="progress1" style="width: 500px;"> </div> 
		   </div> -->
		   <div class="unit">
		   	<div class="progress-bar blue stripes" style="float: left;">
		   	     
             	<span id="spans" style="width: {$percent}%"></span>
           	</div>
            <div style="float: left;margin-top: 35px;margin-left: 5px;" class="stripes"><strong><span id="precent">{$percent}%</span></strong></div>
           </div>
		</div>
		
		<div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">提交</button></div></div></li>
				<li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li>
			</ul>
		</div>
	</form>

</div>

